﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="RawNormManage.aspx.cs" Inherits="StoragePeriod.Web.SysManage.RawNormManage" %>
<%@ Register src="UC_Menu.ascx" tagname="UC_Menu" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
    .layout{ background:url(../images/images_59.jpg) no-repeat;}
    .left-cloumn{display:none;}
    .right-cloumn{width:944px;}
    #sms_title_li_0{ background:url(../images/images_55.jpg) no-repeat;}
    .Left_Search{width:190px;padding-left:10px; height:30px;border-top:1px solid #ccc;}
    .right_Stafflist{ overflow:auto;}
    .RawNorm{width:440px; float:right;margin-right:10px;margin-top:10px;}
    .RawNorm_title{width:438px; height:25px;padding:5px 0px; border:1px solid #c1dfec; background-color:rgb(232, 247, 253);}
    .RawNorm_Main{width:438px;}
</style>
<script type="text/javascript">
    $(document).ready(function () {
        $("#MainContent_Drop_OntNorm").live("change", function () {
            sp.ajax.call("Common", { FunType: "NormType", ParentId: $("#MainContent_Drop_OntNorm").val() }, function (res) {
                $("#MainContent_Drop_TwoNorm").html($("#selectTmpl").tmpl(res.Data));
            }, null, true)
        });
    });

    function ShowDlg(isEdit) {
        if (isEdit == 0 && $("#MainContent_HidSelectRawId").val() == "") {
            alert("请选择原料!");
            return;
        }

        $("#MainContent_HidIsEdit").val(isEdit);
        if (isEdit == 0) {
            $("#MainContent_txt_ElectValue").val("");
        }
        $("#dialog-form").dialog('open');
    }

    function LoadData(OneNorm,TwoNorm,strName) {
        $("#MainContent_Drop_OntNorm").val(OneNorm);
        $("#MainContent_Drop_OntNorm").trigger('change');
        $("#MainContent_Drop_TwoNorm").val(TwoNorm);
        $("#MainContent_txt_ElectValue").val(strName);
    }

    function SetTypeInfo() {
        $("#MainContent_HidNromTypeId").val($("#MainContent_Drop_TwoNorm").val());
    }

    function alertstr(str) {
        alert(str);
    }
</script>
<script id="selectTmpl" type="text/x-jquery-tmpl">
   <option value="${Value}">${Text}</option>
</script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainLeft" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
<asp:UpdatePanel ID="upPanelMain" runat="server">
<ContentTemplate>
<asp:HiddenField ID="HidSelectRawId" runat="server" Value="" />
<asp:HiddenField ID="HidIsEdit" runat="server" />
<asp:HiddenField ID="HidRawNronId" runat="server" />

<asp:HiddenField ID="HidNromTypeId" runat="server" />
<div class="sms_title">
    <ul>
        <li><a href="OperationManage.aspx" style="color:#f90;">基础设置</a></li>
        <li><a href="PrivilegeManage.aspx">权限管理</a></li>
        <li><a href="PersonnelManage.aspx">人员管理</a></li>
    </ul>
</div>
<div class="sms_main">
    <div class="BasicData_left">
        <h2>基础数据管理</h2>
        <uc1:UC_Menu ID="UC_Menu1" runat="server" ShowId=6 />
    </div>
    
    <div class="BasicData_right">
        <div class="BasicData_MainLeft">
            <h2>原料列表</h2>
            <asp:TreeView ID="tvRawView" runat="server" Height="389px" Width="220px"  OnSelectedNodeChanged="tvRawView_SelectedNodeChanged"
                style=" overflow:auto;" SkipLinkText="">
                <SelectedNodeStyle Font-Bold="True" BackColor="#0072BB" ForeColor="#ffffff" />
            </asp:TreeView>
        </div>
        <div class="RawNorm">
            <div class="RawNorm_title">
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td align="left" style="padding-left:10px;">原料：<asp:Label ID="Lab_RawName" runat="server"></asp:Label></td>
                        <td align="right"><input type="button" id="Btn_TypeAdd" value="添加" class="btn_0" onclick="ShowDlg(0)" /></td>
                        <td style="width:10px;"></td>
                    </tr>
                </table>
            </div>
            <div class="BasicDataList RawNorm_Main">
                <table width="100%" border="0" cellpadding="0" cellspacing="0" class="BasicDataTable">
                    <thead>
                        <tr>
                            <td style="width:60px;">序号</td>
                            <td>一级指标</td>
                            <td>二级指标</td>
                            <td>推荐极值</td>
                            <td style="width:60px;">编辑</td>
                            <td style="width:60px;">删除</td>    
                        </tr>
                    </thead>
                    <tbody>
                        <asp:Repeater ID="RepDataList" runat="server" onitemcommand="RepDataList_ItemCommand">
                            <ItemTemplate>
                                <tr>
                                    <td><%=GetXH()%></td>
                                    <td><%#Eval("OneNormName")%></td>
                                    <td><%#Eval("TwoNormName")%></td>
                                    <td><%#Eval("ElectValue")%></td>
                                    <td><asp:Button ID="RepBtn_Edit" CssClass="RepBtn_Edit" runat="server" CommandName="Edit" CommandArgument=<%#Eval("id")%> /></td>
                                    <td><asp:Button ID="RepBtn_Del" CssClass="RepBtn_Del" runat="server" OnClientClick="return confirm('是否删除？');" CommandName="Del" CommandArgument=<%#Eval("id")%> /></td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<div class="sms_foot">
<asp:HiddenField ID="hdRoleCode" runat="server" />
    <img src="../images/images_58.jpg" width="944" height="8" class="float_left" />
</div>
</ContentTemplate>
</asp:UpdatePanel>

<div class="sp-dialog-box" id="dialog-form" style=" width:350px;" title="原料指标维护">
    <table class="sp-input-table " border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td style="padding:5px 0px;">一级指标：</td>
            <td><asp:DropDownList ID="Drop_OntNorm" runat="server"></asp:DropDownList></td>
        </tr>
        <tr>
            <td style="padding:5px 0px;">二级指标：</td>
            <td><asp:DropDownList ID="Drop_TwoNorm" runat="server"></asp:DropDownList></td>
        </tr>
        <tr>
            <td style="padding:5px 0px;">推荐极值：</td>
            <td><asp:TextBox runat="server" class="text ui-widget-content ui-corner-all" ID="txt_ElectValue" /></td>
        </tr>
        <tr>
            <td colspan="2"><asp:Button Text="提交" CssClass="die" runat="server" OnClientClick="SetTypeInfo()" ID="btPost" OnClick="btPost_Click" /></td>
        </tr>
    </table>
</div>
</asp:Content>